﻿namespace DotNet.WinForm.Utilities.Controls
{
    public class DotNetDataGridColumn : DevExpress.XtraGrid.Columns.GridColumn
    {
        public DotNetDataGridColumn()
        {
            this.Visible = true;
            this.VisibleIndex = 0;
            this.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
            this.OptionsFilter.AllowAutoFilter = false;
            this.OptionsFilter.AllowFilter = false;
            this.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
        }

        public string DataFieldName
        {
            get
            {
                return this.FieldName;
            }
            set
            {
                this.FieldName = value.ToUpper();
            }
        }
    }

    public class DotNetDataGridCheckBoxColumn : DotNetDataGridColumn
    {
        public DotNetDataGridCheckBoxColumn()
        {
            DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit checkEdit = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
            checkEdit.ValueChecked = true;
            checkEdit.ValueUnchecked = false;
            checkEdit.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked;
            this.ColumnEdit = checkEdit;
        }
    }

    public class DotNetDataGridTextBoxColumn : DotNetDataGridColumn
    {
    }

    public class DotNetDataGridButtonColumn : DotNetDataGridColumn
    {
        private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repButton = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();

        public DotNetDataGridButtonColumn()
        {
            DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repButton = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
            this.ColumnEdit = repButton;
        }

        public string Text
        {
            get;
            set;
        }

        public string ToolTipText
        {
            get;
            set;
        }
    }
}